Quickfingers Luc's Base Breaking Strategy v2.5 - 3Commas EditionIntroduction
The strategy attempts to implement a popular price action strategy by Luc Thomas (a.k.a. Quickfingers Luc) typically referred to as a QFL base-breaking strategy specifically for the 3Commas platform. The Input settings have been redesigned to match the same inputs as the 3Commas My Bot Settings page. Only the "Deal Start Condition" section will echo the required QFL-related settings found in the original Quickfingers Luc's Base Breaking Strategy v2.5 to successfully implement the strategy.
The strategy revolves around price action movements that reveal “bases”, which are price levels of support that have a significant, rapid price surges called “bounces”. Once a base is revealed, the base price level is used as reference to implement multiple entries below the base using a layering technique of dollar-cost averaging to place multiple limit orders at various price levels below the base price. As price action breaks below the base price, the limit orders will be filled, and the take profit, breakeven and stop loss prices will be recalculated.
How is it original and useful?
This strategy is unique in that the strategy version fully supports the TradingView backtester, which will enable you to perform experiments with various settings to evaluate performance using the historical chart data. The study version implements the "Start Deal" and "Close Deal" alerts for you to integrate with 3Comma's "Trading View Custom Signal" start condition. Both script versions will provide the same configuration abilities. The following list is a brief description of its usefulness:
The ability to define the QFL base confirmation settings, including volume analysis.
The ability to define your preferred layering strategy of either dollar-cost averaging (DCA) or grid-like layers along with precise layer placement.
The ability to define your trading parameters like take profit and stop loss offsets, exchange commission rates, trading start time, and position size multiplication for each layer.
The ability to define flexible trade eligibility rules that can use other chart indicators, like RSI or EMA, to exclude the selection of base prices for trading.
The ability to set the visibility & color theme of the detailed statistics from the chart history pertaining to trading sessions started and closed, session durations, win rate, price action drops and bounces, as well as layer utilization.
How does it compare to other scripts in the Public Library?
The strategy offers a very detailed, comprehensive settings to implement the QFL base-breaking strategy ion 3Commas. The strategy version leverages the full features of the TradingView backtester to provide informative, detailed performance measurements surrounding this unique trading strategy. The study version will implement the latest alert framework called "Any Alert() Function" where you can create a single alert to handle multiple events, which include:
Deal Start
Deal Close
What does it do and how does it do it?
The strategy can be applied to any chart at any time frame, but the minimum should be no lower than 10 minutes. When applied to the chart for the first time, the default settings will work to render base price levels in orange and 8 DCA layers in thin blue lines. As you scroll through the chart's history you should see price action crossing the DCA layers, denoted with blue triangles, and a green take-profit line will render with green triangle denoting the crossing. Lastly, when a deal session begins upon the crossing of the first layer, the indicator will continue to identify base price levels, but the color of the price lines will be gray. When the trade session concludes upon the crossing of the take profit line, the indicator will switch the most recent base price line from gray to orange to make it active and eligible for trading.
As price action develops, the indicator will use the "Base Confirmation Settings" to look back by counting the number of bars to the left and right of a pivot low point, measure the price drops and bounces, and volume amounts to validate that they are within the specified values. If so, the indicator will draw an orange triangle beneath the candle bar to denote it as the pivot low point and begin rendering the orange line as the base price. The DCA layers will be calculated and offset relative to the base price using thin blue lines.
Optionally, the breakeven price line will be drawn to help visualize the true breakeven price which takes into consideration the exchange fees being applied. Base line, take profit, stop loss and DCA layer crossings will be denoted with colorful shapes to help visually recognize the events on the chart.
The volume is validated only at the pivot low candle. It will measure the volume against the moving average to determine base confirmation. A volume factor of 1 will mean that the volume must be at least the same value as the moving average value. A volume factor of 2 means it must be twice the moving average value.
Lastly, a table of statistics is positioned to the upper-right corner of the chart that summarize all the events that have taken place since the indicator began simulating deal sessions from the chart's history.
Strategy Results
The default settings are designed to define a "weak" QFL base to ensure that the indicator will render chart elements when first loaded as well as to allow the backtester to gather order executions and display performance summary. The strategy version is using $10,000 initial capital, a commission rate of 0.1% for both entries and exits, and a 1 tick slippage setting. It is also using 3.4881% of the equity for the Base Order Size, 4.7097% of equity for the first Safety Order Size. The Maximum Safety Trade Count is 7 with a Safety Order Volume Scale of 1.35, and a take profit of 5% with no stop loss. All other settings are defaults.
It is recommended that the indicator be "tuned" for your specific market in order to best implement the QFL trading strategy and obtain better desirable results. You do so by using the statistics table and observe the Mean Price Drop and Bounce values to learn what the indicator is detecting when it measures from the pivot low points. Using this information, you can adjust the Base Confirmation Settings accordingly, along with any volume specifications you require, to configure the indicator for the chart.
Always keep in mind that past performance may not be indicative of future results. Settings that seem favorable for one market may be found to be disastrous in another. Therefore, do take the time needed to understand how the settings will behave with the given chart symbol.
Enjoy! 😊👍
How to obtain access to the script?
You have two choices:
Use the "Website" link below to obtain access to this indicator, or
Send us a private message (PM) in TradingView itself.
Cari dalam skrip untuk "stop loss"
Quickfingers Luc's Base Breaking Strategy v2.5Introduction
The strategy attempts to implement a popular price action strategy by Luc Thomas (a.k.a. Quickfingers Luc) typically referred to as a QFL base-breaking strategy. The strategy revolves around price action movements that reveal “bases”, which are price levels of support that have a significant, rapid price surges called “bounces”. Once a base is revealed, the base price level is used as reference to implement multiple entries below the base using a layering technique of dollar-cost averaging to place multiple limit orders at various price levels below the base price. As price action breaks below the base price, the limit orders will be filled, and the take profit, breakeven and stop loss prices will be recalculated.
How is it original and useful?
This strategy is unique in that the strategy version fully supports the TradingView backtester, which will enable you to perform experiments with various settings to evaluate performance using the historical chart data. The study version implements numerous custom alerts for you to build TradingView notifications around specific price action events and stay informed with market activity in real-time. Both script versions will provide the same configuration abilities where you can define:
Base confirmation settings, including volume analysis.
Your preferred layering strategy of either Dollar-cost averaging (DCA) or grid-like layers along with precise layer placement.
Your trading parameters like take profit and stop loss offsets, exchange commission rates, trading start time, and position size multiplication for each layer.
Flexible trade eligibility rules that can use other chart indicators, like RSI or EMA, to exclude the selection of base prices for trading.
The visibility of detailed statistics from the chart history pertaining to trading sessions started and closed, session durations, win rate, price action drops and bounces, as well as layer utilization.
How does it compare to other scripts in the Public Library?
The strategy offers a very detailed, comprehensive settings to address all types of markets found on TradingView where you can implement the QFL base-breaking strategy. The strategy version can be considered the first of its kind on TradingView to leverage the backtester to provide informative, detailed performance measurements surrounding this unique trading strategy. The study version will contain numerous custom alerts to aid in your notification preferences and stay informed on the indicator's activities:
Base Created
Base Cracked
Base Respected
Any Layer Cracked
Layer 1 Cracked
Layer 2 Cracked
Layer 3 Cracked
Layer 4 Cracked
Layer 5 Cracked
Layer 6 Cracked
Layer 7 Cracked
Layer 8 Cracked
Layer 9 Cracked
Layer 1 Respected
Layer 2 Respected
Layer 3 Respected
Layer 4 Respected
Layer 5 Respected
Layer 6 Respected
Layer 7 Respected
Layer 8 Respected
Take Profit Crossed
Stop Loss Crossed
What does it do and how does it do it?
It is recommended that you start with a chart that is on an hourly timeframe with the "Scale Price Chart Only" chart setting enabled. When applied to the chart for the first time, the default settings will work to render base price levels in orange and 8 DCA layers in blue using a Fibonacci-like sequence for the deviation offset relative to the base price. As you scroll through the chart's history you should see price action crossing the DCA layers, denoted with blue triangles, and a green take-profit line will render with green triangle denoting the crossing. Lastly, when a trade session begins upon the crossing of the first layer, the indicator will continue to identify base price levels, but the color of the price lines will be gray. When the trade session concludes upon the crossing of the take profit line, the indicator will switch the most recent base price line from gray to orange to make it active and eligible for trading.
As price action develops, the indicator will use the "Base Confirmation Settings" to look back by counting the number of bars to the left and right of a pivot low point, measure the price drops and bounces, and volume amounts to validate that they are within the specified values. If so, the indicator will draw an orange triangle beneath the candle bar to denote it as the pivot low point and begin rendering the orange line as the base price. The DCA layers will be calculated and offset relative to the base price using thin blue lines.
Optionally, the breakeven price line will be drawn to help visualize the true breakeven price which takes into consideration the exchange fees being applied. Base line, take profit, stop loss and DCA layer crossings will be denoted with colorful shapes to help visually recognize the events on the chart.
The volume is validated only at the pivot low candle. It will measure the volume against the moving average to determine base confirmation. A volume factor of 1 will mean that the volume must be at least the same value as the moving average value. A volume factor of 2 means it must be twice the moving average value.
Lastly, the very last bar will render a table of statistics that summarize all the events that have taken place since the indicator began simulating trading sessions from the chart's history.
Strategy Results
The default settings are designed to define a "weak" QFL base to ensure that the indicator will render chart elements when first loaded as well as to allow the backtester to gather order executions and display performance summary. The strategy version is using $10,000 initial capital, a commission rate of 0.1% for both entries and exits, and a 1 tick slippage setting. It is also using 3.4887% of the equity with a Position Size Multiplier of 1.35, using 8 total DCA layers, and a take profit of 5% with no stop loss. All other settings are defaults.
It is recommended that the indicator be "tuned" for your specific market in order to best implement the QFL trading strategy and obtain better desirable results. You do so by using the statistics table and observe the Mean Price Drop and Bounce values to learn what the indicator is detecting when it measures from the pivot low points. Using this information, you can adjust the Base Confirmation Settings accordingly, along with any volume specifications you require, to configure the indicator for the chart.
Always keep in mind that past performance may not be indicative of future results. Settings that seem favorable for one market may be found to be disastrous in another. Therefore, do take the time needed to understand how the settings will behave with the given chart symbol.
Enjoy! 😊👍
How to obtain access to the script?
You have two choices:
Use the "Website" link below to obtain access to this indicator, or
Send us a private message (PM) in TradingView itself.
MACD-Extendido-Estrategia por Neil--------------------------------
MACD-Extendida-Estrategia
--------------------------------
DESCRIPTION
Resource that identifies entry and exit operations using the indicator
Average Convergence and Divergence Movements ( MACD ) and 5 strategies
INTERESTING
Novel strategies are implemented such as:
1. Overbought and oversold band to avoid horizontal movements
2. Control inputs and outputs at positions opposite the histogram line
3. Make a profit (take profit) without prior purchase orders
HOW DOES IT WORK (STRATEGIES)
1) Overbought and oversold:
Allows you to define an overbought upper band
Allows you to define an oversold ower band
Operations that occur within the band are ignored
2) Place of next operation (either side):
Indicates that the next operation can occur on either side of the histogram
3) Place of next operation (opposite side):
Indicates that the next operation must occur on the opposite side of the histogram
4) Take profit:
It allows defining the deviation in favor to execute a take profit.
It does not place a buy order at a distant point, instead it looks back and if the shift meets the expected deviation, take profit is executed
5) Loss control (stop loss):
It allows to define the deviation against to execute a stop loss.
It does not place a stop order at a distant point, instead it looks back and if the displacement meets the expected deviation the stop loss is executed
How to use it:
Press the "Indicators" option, go to the "Public Librarian" segment, write the name "MACD-Extended-Strategy by Neil", double-click on the record in question and you will have it added in your work panel, now, just It remains to be used to identify the inputs and outputs and you can do it visually or by defining the automatic notification alerts.
--------------------------------
MACD-Extendida-Estrategia
--------------------------------
DESCRIPCION
Recurso que identifica operaciones de entradas y salida haciendo uso del indicador
Media móvil de Convergencia/Divergencia ( MACD ) y 5 estrategias
NOVEDADES
Se implementan estrategias novedosas como:
1. Banda de sobrecompra y sobreventa para esquivar movimientos horizontales
2. Control de entradas y salidas en posiciones contrarias a la línea del histograma
3. Toma de ganancias (take profit) sin ordenes de compra previa
COMO FUNCIONA (ESTRATEGIAS)
1) Sobrecompra y Sobreventa:
Permite definir una banda superior de sobrecompra
Permite definir una banda inferior de sobreventa
Operaciones que ocurren dentro de la banda son ignoradas
2) Lugar de próxima operación (cualquier lado):
Indica que la próxima operación puede ocurrir en cualquier lado del histograma
3) Lugar de próxima operación (lado opuesto):
Indica que la próxima operación debe ocurrir en el lado opuesto del histograma
4) Toma de ganancias (take profit):
Permite definir la desviación a favor para ejecutar una toma de ganancia.
No coloca una orden de compra en un punto distante, en su lugar mira hacia atrás y si el desplazamiento cumple con la desviación esperada se ejecuta la toma de ganancia
5) Control de pérdida (stop loss):
Permite definir la desviación en contra para ejecutar una parada de pérdida.
No coloca una orden de parada en un punto distante, en su lugar mira hacia atrás y si el desplazamiento cumple con la desviación esperada se ejecuta la parada de la pérdida
Como usarlo:
Presione la opción "Indicadores", ubíquese en el segmento "Libreria Publica", escriba el nombre "MACD-Extendido-Estrategia por Neil", haga doble clic sobre el registro en cuestión y lo tendrá agregado en su panel de trabajo, ahora, solo resta usarlo para identificar las entradas y salidas y puede hacerlo de forma visual o definiendo las alertas de notificación automática.
Zendog V2 backtest DCA bot 3commasHi everyone,
After a few iterations and additional implemented features this version of the Backtester is now open source.
The Strategy is a Backtester for 3commas DCA bots. The main usage scenario is to plugin your external indicator, and backtest it using different DCA settings.
Before using this script please make sure you read these explanations and make sure you understand how it works.
Features:
- Because of Tradingview limitations on how orders are grouped into Trades, this Strategy statistics are calculated by the script, so please ignore the Strategy Tester statistics completely
Statistics Table explained:
- Status: either all deals are closed or there is a deal still running, in which case additional info
is provided below, as when the deal started, current PnL, current SO
- Finished deals: Total number of closed deals both Winning and Losing.
A deal is comprised as the Base Order (BO) + all Safety Orders (SO) related to that deal, so this number
will be different than the Strategy Tester List of Trades
- Winning Deals: Deal ended in profit
- Losing deals: Deals ended with loss due to Stop Loss. In the future I might add a Deal Stop condition to
the script, so that will count towards this number as well.
- Total days ( Max / Avg days in Deal ):
Total Days in the Backtest given by either Tradingview limitation on the number of candles or by the
config of the script regarding "Limit Date Range".
Max Days spent in a deal + which period this happened.
Avg days spent in a deal.
- Required capital: This is the total capital required to run the Backtester and it is automatically calculated by
the script taking into consideration BO size, SO size, SO volume scale. This should be the same as 3commas.
This number overwrites strategy.initial_capital and is used to calculate Profit and other stats, so you don't need
to update strategy.initial_capital every time you change BO/SO settings
- Profit after commission
- Buy and Hold return: The PnL that could have been obtained by buying at the close of the first candle of the
backtester and selling at the last.
- Covered deviation: The % of price move from initial BO order covered by SO settings
- Max Deviation: Biggest market % price move vs BO price, in the other direction (for long
is down, for short it is up)
- Max Drawdown: Biggest market % price move vs Avg price of the whole Trade (BO + any SO), in the other
direction (for long price goes down, for short it goes up)
This is calculated for the whole Trade so it is different than List of Trades
- Max / Avg bars in deal
- Total volume / Commission calculated by the strategy. For correct commission please set Commission in the
Inputs Tab and you may ignore Properties Tab
- Close stats for deals: This is a list of how many Trades were closed at each step, including Stop Loss (if
configured), together with covered deviation for that step, the number of deals, and the percentage of this
number from all the deals
TODO: Might add deal avg value for each step
- Settings Table that can be enabled / disabled just to have an overview of your configs on the chart, this is a
drawn on bottom left
- Steps Table similar to 3commas, this is also drawn on bottom left, so please disable Settings table if you want
to see this one
TODO: Might add extra stats here
- Deal start condition: built in RSI-7 or plugin any external indicator and compare with any value the indicator plots
(main purpose of this strategy is to connect your own studies, so using external indicator is recommended)
- Base order and safety orders configs similar to 3commas (order size, percent deviation, safety orders,
percent scale and volume scale)
- Long and Short
- Stop Loss
- Support for Take profit from base order or from Total volume of the deal
- Configs help (besides self explanatory):
- Chart theme: Adjust according to the theme you run on. There is no way to detect theme at the moment.
This adjust different colors
- Deal Start Type: Either a builtin RSI7 or "External indicator"
- Indicator Source an value: If using External Indicator then select source, comparison and value.
For example you could start a deal when Volume is greater than xxxx, or code a custom indicator that plots
different values based on your conditions and test those values
- Visuals / Decimals for display: Adjust according to your symbol
- BO Entry Price for steps table: This is the BO start deal price used to calculate the steps in the table
Futures Spot Difference Strategy by MoonFlag
This strategy compares the spot and futures value of a coin on a given exchange
If the 'Percent Difference' (See settings) is greater than a user specified ammount a blue (long) or green(short) line is put on the chart.
Default % difference typically varies from 0.2 to 0.7 depending on the coin and timeframe. On higher timeframes (1hour) a difference of 1.5% might be required to give good intermittent trade results.
I've chosen a USD-USDT comparison as default for ease of understanding. Note the futures coin goes onto the chart and the spot coin is referenced in settings. The bot works this way as the futures will typically extend beyond the spot price, not the other way around.
User can select if to include Long and/or Short trades.
The 'Trigger Only When Bar Complete' means that repainting should not be an issue if set to true. However, if set to false the strategy will enter a trade at the point in time when the percentage difference is met. This is useful with some coins as the futures coins price rapidly changes to realign with the spot price. It is however difficult to backtest this feature as backtests only consider the bar complete situation. I mostly use Trigger When Bar Complete = true, as a difference in the spot/ futures price is typically followed by a price shift trend over then next reasonable time period.
Timing is essential in this bot. There is a stop-loss however, this stop value is replaced by a exp ramp which has 3 variables (starting %, length, run-up). When the ramp is narrower to the price than the stop-loss the ramp takes over the stop-loss and this reduces losses. Also, there is an option to have the ramp take over the take-profit if the ramp betters the start-price (i.e. the trade is in profit). This is very useful for times when the price massively swings beyond the take-profit price as the exp ramp goes way up. The ramp also limits the time a trade will stay in position, unless the trades moves in tandem with the ramp. The ramp is the most useful feature I have for bots, I use it all the time.
So a difference between the spot and futures price - can lead to a trend establishing, so catch these with this bot. It works well on fast timeframes, 1m, 5m, 15m, and also is useful with the 1hour and similar.
Please get in touch to have this bot matched to any coin pair
Please do get in touch if you have any questions/suggestions.
Sincerely,
MoonFlag PhD
Scalp - 50/200 EMAWorks on any timeframe but was built originally for scalping. Uses 50EMA and 200EMA to define the trend and touch backs on to the 50 EMA for entry.
200 EMA - White Line
50 EMA - Yellow Line
ATR: Length 14 Smoothing RMA
1. Wait for 50ema to crossover 200 ema – Then wait for candle to touch 50 ema after the cross.
2. Entry: Green candle that closes above 50 ema without getting more than 3 candles closing below(BUY) or above (SELL) 50ema.
3. Stop loss: 2x ATR value below entry candle.
4. Take profit: 1.5x the risk.
Settings allow for # of Entries allowed per trend as well as EMA periods.
Opposite for Sell Entries (Stop Loss: 2x ATR value above entry candle)
Scalper Helper System===========================================================================
===========================================================================
Description
===========================================================================
===========================================================================
Scalper Helper System combines a series of trade strategies which have been learned and honed in the Jim of All Trades channel.
Paixy has contributed candlestick combination rules, Jonas has shared his deep understanding of Stochastic.
Jim himself has taught clearly on the merits of RSI.
This system attempts to formulate all the notes and rules I have made over the past months.
The system searches for 10 - 15 rules which are divided into bullets and bombs. Bombs relate to momentum, so these signals may not be pinpoint accurate, but they are more often leading to bigger moves.
This initial version is released mainly only to the JOAT community to help continue the development of the idea and to help find
continued improvements.
Special thanks to FiendishFeather for his strategy work, (check out his work to learn how to apply any trading strategy to his back testing harness), and the date filtering snippet and the tip to show this option at the top.
===========================================================================
===========================================================================
The strategy decisions are based on the following general rules:
===========================================================================
===========================================================================
BULLETs are hint to the idea of firing a small sized position into the market, BOMBs are hints to go all in - however this does not mean proper risk management should be forgotten.
Without risk management this and any strategy will lead to failure.
Without risk management this and any strategy will lead to failure.
Without risk management this and any strategy will lead to failure.
Without risk management this and any strategy will lead to failure.
===========================================================================
Bullet1 uses the value of the stochastic and checks for buy/sell cross over on 5m, 8m and 13m chart.
These values should be calculated on a ratio basis ideally.
Bullet2 measures divergence between the printed Stochastic signals.
Bullet3 has been decommissioned.
Bullet4 is an RSI divergence and value indicator.
Bullet5 has been decommissioned.
Bullet6 uses the history of the stochastic buy and sell signals
Bullet7 uses the Scalper Helper Trends for entries by attempting to see how the overall trend is changing. More refinement is needed here.
Bullet8 uses the Scalper Helper Trends on multiple timeframes for entries.
Bullet9 strict buy/sell signals from Stochastic RSI
Bomb1 relies on the Fast, Medium and Slow MA's being correctly lined up as well as the Stochastic, this hints at a more imminent move and so the strategy suggests a quicker entry.
Bomb2 relies on the Fast, Medium and Slow MA's NOT being correctly lined up as well as the Stochastic, and therefore has the luxury of suggesting Limit orders near the local high/low.
Bomb3 looks for two or more Stochastics signals in the same direction and then performs a divergence calculation.
Bomb4 looks a change in the Stochastics signals direction and then performs a divergence calculation.
===========================================================================
===========================================================================
Configuration settings:
===========================================================================
===========================================================================
Users can chose to show mainly buy and/or sell signals and can select a level of strictness. Enabling strict rules will force a multi timeframe comparison of Stochastic analysis.
Users can try different levels for long and short targets for profit and stop loss. This is important because the market does not behave the same going up as it does going down.
The RSI conditional check makes the strategy more selective. This discernment can be applied to bullets or bombs in order to validate entry and exits.
During the bull run and perhaps even in ranging markets, the RSI overbought levels is usually 70-80, but in the bear market we are seeing in Crypto now, a value of 60 is more useful. Try for yourself to see what works for you and feedback in the comments.
An additional indicator, Scalper Helper Trends is recommended to get a quick view on the trend condition (rally, base, down) by viewing the MACD from multiple time frames. Further research is required to know which larger timeframes work best here.
For the 15min chart, 15m, 30m, 45m, 60m, 120m, 240m, 360m, 960m would work well. Note it is not possible to go higher than 1000 at this time.
Whether you use the Scalper Helper trends or not for your own visual confirmation, it is possible to allow this indicator to attempt to read it for you. More research is required to best model the reading of this. For now, it will simply measure the gradient of the number of up versus down colors.
The system can also find entries off the Scalper Helper Trends - but really this, by design is not the best use of Scalper Helper Trends. Although you may prove me wrong so the option is given for you to find buy/sells with your own testing.
Users can chose to use some engulfing candle arrangements to trigger exits and define the length of the 200MA and decide if this should play a part in the filtering of the signals. Similarly, a check can be made to ensure that the first two candles after a signal are behaving as we would expect with the "Wait for 2 closing in the direction of the signal" option. This has a lot of value on the 1min chart.
When Revenge trade is set to true you may re-enter a trade in the same direction as the last one when the last one was stopped out, otherwise you would only be looking for trades in the other direction. We all should not revenge trade, and indeed I have only seen a few cases when it has increased the profitability, however this option remains for now.
The flip opens a new trade in the reverse direction when a signal is given to close a trade, but does not apply to scenarios where stop losses or take profit closed the trade.
Follow the Trend with Fib support LevelsThis is trend following strategy. Which takes entries on the pullbacks when long term trend is up.
It allows you to enter / add on pullback of Fib 0.618 of prebious N number of candles. I have defaulted this to 9.
BUY
====
1. Long term trend is UP i.e ema 50 is above ema 200
2. wait for Fib0.618 pulls back to trend zone (orange line )
3. when the close cross above Fib0.618 line , Enter BUY or ADD to existing position
Exit
====
1. Wait for Fib0.618 come out of Trend zone
2. close partial , when price cross down below Fib0.236
Stop Loss
========
1. Stop Loss set as Trailing Stop Loss , defaulted to 5%
you can also use ATR as trailing stop loss.
I have tested with SPY , QQQ and AAPL on hourly chart
Warning
========
for the use of educational purpose only. If you want to trade the startegy signals, please do yor own research.
Pullback Traps v. 0.1Trading Strategy for scalping the CME_MINI:ES1! and CME_MINI:MES1! futures on the 5 min. time frame.
The strategy will count legs and look for failed pullbacks and failed second entries where shorters get trapped.
How to use:
When a trap occurs (Marked with green light) place an order one tick above the high of the trap and enter on next candle
If entry doesn't happen on next candle and it has a lower high, move entry to one tick above high of that candle.
Keep doing the above until you enter or until a candle is marked with a blue light and the text Trap Dead.
If you see Trap dead and you haven't entered, quickly cancel your order.
What is green light?
A second or later pullback down away from the uptrend. When the green light is present the shorters haven't made a 1 point profit and short scalpers are trapped.
What is blue light?
1. Shorters made their 1 point profit and trap is dead. Cancel your trade. Or...
2. Shorters hit their stop loss and you're probably in a trade now and about to profit.
Profit and stop loss:
Numbers are done with profit 5 ticks and stop loss 30 ticks.
Should I have a stop loss 6 times greater than profit?
Probably not. The numbers you see here are made with these profit and stop loss figures but I don't advice it in real trading.
The numbers look good on this backtest but in reality a few bad trades would ruin everything.
This was made purely for fun and sim trading - Feel free to do your own testing and show the resulsts.
Follow the Trend - Trade PullbacksKindly follow the rules stated below for entry, exit and stop loss. Not every Buy / Sell signal will be profitable.
Timeframe of the chart acts as current timeframe. You need to choose 2 more as middle and higher timeframes.
This indicator is based on candlesticks, ATR and CCI indicators and the logic provides buy / sell signals at the pullbacks of the trend depicted by higher timeframe, that must be respected throughout.
Enter the long / short trade respectively when the indicator gives buy / sell signal after price has gone below the green / above the red line for higher timeframe.
Stop loss shall be low / high of recent swing. Exit when the price closes below / above the middle timeframe, to be used as trailing target.
Use it for any instrument for any timeframe of your choice.
For example, check the shared chart. It is a 1 min intraday, but the indicator can be used for short or long term positional trades as well.
Enter long at 14102, with stop loss 14077. Trailing target is achieved at 14156 giving a Risk:Reward ratio of 1:2.
Another Buy signal is observed around same level and uptrend continues till day end, again for a Risk:Reward ratio of approx. 1:2.
Rules to follow for Long trades -
Enter long position at Buy signal given after price has moved below green line of higher timeframe.
Exit the position when price closes below orange / blue line of middle timeframe.
Stop loss must be at low of recent swing, appearing just before the Buy signal.
Rules to follow for Short trades -
Enter short position at Sell signal given after price has moved above red line of higher timeframe.
Exit the position when price closes above orange / blue line of middle timeframe.
Stop loss must be at high of recent swing, appearing just before the Sell signal.
Noro's ZZ-6 by hamster-botThe original script is available here
New version of ZZ-strategy.
Repaint?
Normal lines are not redrawn. Dotted lines repaint, but do not affect trading (do not affect backtests). You can turn off repaint in the script settings. Repaint (dotted lines) are needed only for clarity. To make it clear from which bar the level is created.
Levels
Lime lines above - level from a local high bar. To open a long position. Using a market stop order.
Red line at the bottom - the level from a local low bar. To open a short position. Using a market stop order.
Trading
You can trade without short positions. Then the red line is the level for a stop-loss order.
Reverse trading can be used. Without stop-loss orders.
Risk size
Order size depends on the risk size parameter and possible loss. If risk size = 2%, it means that the loss will be no more than 2%.
For crypto
Symbols: XBT/USD, BTC /USD, BTC /USDT, ETH/USD, etc - need USD(T)
Timeframes: 1h, 4h, 1d
The script will continue to be developed by the Hamster Bot team
Noro's ZZ-6 StrategyNew version of ZZ-strategy.
Repaint?
Normal lines are not redrawn. Dotted lines repaint, but do not affect trading (do not affect backtests). You can turn off repaint in the script settings. Repaint (dotted lines) are needed only for clarity. To make it clear from which bar the level is created.
Levels
Lime lines above - level from a local high bar. To open a long position. Using a market stop order.
Red line at the bottom - the level from a local low bar. To open a short position. Using a market stop order.
Trading
You can trade without short positions. Then the red line is the level for a stop-loss order.
Reverse trading can be used. Without stop-loss orders.
Risk size
Order size depends on the risk size parameter and possible loss. If risk size = 2%, it means that the loss will be no more than 2%.
For crypto
Symbols: XBT/USD, BTC/USD, BTC/USDT, ETH/USD, etc - need USD(T)
Timeframes: 1h, 4h, 1d
Noro's RiskChannel StrategyIndicator
The Donchian price channel is used. There are 2 methods available to close the position. The user can choose a method.
Wikipedia: en.wikipedia.org
Strategy #1 (stop-loss type = channel)
Old classic trading strategy, using breakouts of the Donchan price channel.
If the price is above the price channel top line, open the long position (and close the short position)
If the price is below the lower line of the price channel, open the short position (and close the long position)
It is recommended that you all use market stop orders.
Strategy #2 (stop-loss type = center)
This metod is better. This method is recommended.
The central line (red) is the middle of the Donchian price channel. Used to close any positions.
If the price is higher than the price channel top line, open the long position.
If the price is lower than the lower line of the price channel, open the short position.
If the price has crossed the central line of the channel, close any position.
It is recommended that you all use market stop orders.
Risk
There are 2 options. Risk for long positions and risk for short positions. This is the size of the possible loss. Order size depends on the possible loss and is calculated for each position.
For
BTC/USD, BTC/USDT, XBT/USD, ETH/USD, ETH/USD (need USD!)
Timeframes: 1h and length of price channel = 50 bars or 4h and length of price channel = 12
BKN: Thick Cut StrategyThick Cut is the juiciest BKN yet. This indicator is created to take a profitable trading strategy and turn it into an automated system. We've built in several pieces that professional traders use every day and turned it into an algo that produces on timeframes as low as 1, 3, and 5 minutes!
Limit Order Entries: When criteria is met, an alert is signaled that will send a value to enter a position at a limit price.
Built in Stop Loss: A stop is built in and the value can be sent to your bot using the {{plot}} function or you can rely on a TradingView alert when the stop is hit.
Built in Take Profits: We've built in two separate take profits and the ability to move your stop loss to breakeven after the first take profit is hit. Even if you take 50% profit at 1R and move your stop loss, you already have a profitable trade. Test results show 50% profits at 2R and the remainder at higher returns result in exceptional results.
Position Sizing: We've built in a position size based on your own predetermined risk. Want to risk $100 per trade? Great, put in 100 in the inputs and reference a quantity of {{plot("Position Size")}} in your alert to send a position size to the bot. You can also reference {{plot("Partial Close")}} to pull 50% of the position size closing 50% at TP1 and 50% at TP2.
Backtest results shown are very short term since we are viewing a 15m chart. This can be a profitable strategy on many timeframes, but lower timeframes will maximize results.
A unique script with incredible results. Further forward testing is live.
***IMPORTANT***
For access, please do not comment below. Comments here will not be replied to. Please send a DM here or on my linked Twitter. At this time, this strategy is considered a Beta release as we continue to fine tune settings and more. Expecting 2 weeks of beta with official release around June 6.
TTS Triple Threat SMA10-30-200 TLTTS Triple Threat SMA10-30-200 TL is a crossover and crossunder trading system that is based on three simple moving averages (SMA).
The default settings are optimized for 4-hour charts.
The TTS Triple Threat trading system works as follows:
1. Enters BULLISH trade when LE Trade & LONG signals are shown on the chart.
2. Enters BEARISH trade when SE Trade & SHORT signals are shown on the chart.
3. LONG and SHORT signals are shown based on SMA crosses for visual inspection but doesn't mean they are trades. Either LE Trade or SE Trade signals need to be present for a trade to take place.
4. TTS Triple Threat SMA10-30-200 TL uses trailing stop loss settings. The ratios between the profit taking settings and trailing loss stops are important to the strategy. Trailing stop loss exits are shown on the chart as XL STOP LOSS or XS STOP LOSS. Profit exits are shown as XL PROFIT EXIT and XS PROFIT EXIT.
Total Trend Follow Strategy with Pyramid and DCA
Introduction
This is a Pine 4 trend following strategy. It has a twin study with several alerts. The design intent is to produce a commercial grade signal generator that can be adapted to any symbol and interval. Ideally, the script is reliable enough to be the basis of an automated trading system web-hooked to a server with API access to crypto, forex and stock brokerages. The strategy can be run in three different modes: long, short and bidirectional.
As a trend following strategy, the behavior of the script is to buy on strength and sell on weakness. As such the trade orders maintain its directional bias according to price pressure. What you will see on the chart is long positions on the left side of the mountain and short on the right. Long and short positions are not intermingled as long as there exists a detectable trend. This is extremely beneficial feature in long running bull or bear markets. The script uses multiple setups to avoid the situation where you got in on the trend, took a small profit but couldn’t get back in because the logic is waiting for a pullback or some other intricate condition.
Deep draw-downs are a characteristic of trend following systems and this system is no different. However, this script makes use of the TradingView pyramid feature accessible from the properties tab. Additional trades can be placed in the draw-down space increasing the position size and thereby increasing the profit or loss when the position finally closes. Each individual add on trade increases its order size as a multiple of its pyramid level. This makes it easy to comply with NFA FIFO Rule 2-43(b) if the trades are executed here in America. The inputs dialog box contains various settings to adjust where the add on trades show up, under what circumstances and how frequent if at all. Please be advised that pyramiding is an advanced feature and can wipe out your account capital if your not careful. During the backtest use modest setting with realistic capital until you discover what you think you can handle.
In addition to pyramiding this script employs DCA which enables users to experiment with loss recovery techniques. This is another advanced feature which can increase the order size on new trades in response to stopped out or winning streak trades. The script keeps track of debt incurred from losing trades. When the debt is recovered the order size returns to the base amount specified in the TV properties tab. The inputs for this feature include a limiter to prevent your account from depleting capital during runaway markets. The main difference between DCA and pyramids is that this implementation of DCA applies to new trades while pyramids affect open positions. DCA is a popular feature in crypto trading but can leave you with large “bags” if your not careful. In other markets, especially margin trading, you’ll need a well funded account and much experience.
Consecutive loss limit can be set to report a breach of the threshold value. Every stop hit beyond this limit will be reported on a version 4 label above the bar where the stop is hit. Use the location of the labels along with the summary report tally to improve the adaptability of system. Don’t simply fit the chart. A good trading system should adapt to ever changing market conditions. On the study version the consecutive loss limit can be used to halt live trading on the broker side (Managed manually).
Design
This script uses nine indicators on two time frames. The chart (primary) interval and one higher time frame which is based on the primary. The higher time frame identifies the trend for which the primary will trade. I’ve tried to keep the higher time frame around five times greater than the primary. The original trading algorithms are a port from a much larger program on another trading platform. I’ve converted some of the statistical functions to use standard indicators available on TradingView. The setups make heavy use of the Hull Moving Average in conjunction with EMAs that form the Bill Williams Alligator as described in his book “New Trading Dimensions” Chapter 3. Lag between the Hull and the EMAs form the basis of the entry and exit points. The alligator itself is used to identify the trend main body.
The entire script is around 1700 lines of Pine code which is the maximum incidental size given the TradingView limits: local scopes, run-time duration and compile time. I’ve been working on this script for over a year and have tested it on various instruments stocks, forex and crypto. It performs well on higher liquidity markets that have at least a year of historical data. Though it can be configured to work on any interval between 5 minutes and 1 day, trend trading is generally a longer term paradigm. For day trading the 10 to 15 minute interval will allow you to catch momentum breakouts. For intraweek trades 30 minutes to 1 hour should give you a trade every other a day. Four hours and above are for seasoned deep pocket traders. Originally, this script contained both range trading and trend following logic but had to be broken into separate scripts due to the aforementioned limitations.
Inputs to the script use cone centric measurements in effort to avoid exposing adjustments to the various internal indicators. The goal was to keep the inputs relevant to the actual trade entry and exit locations as opposed to a series of MA input values and the like. As a result the strategy exposes over 50 inputs grouped into long or short sections. Inputs are available for the usual minimum profit and stop-loss as well as safeguards, trade frequency, DCA, modes, presets, reports and lots of calibrations. The inputs are numerous, I’m aware. Unfortunately, at this time, TradingView does not offer any other method to get data in the script. The usual initialization files such as cnf, cfg, ini, json and xml files are currently unsupported.
Example configurations for various instruments along with a detailed PDF user manual is available.
Indicator Repainting And Anomalies
Indicator repainting is an industry wide problem which mainly occurs when you mix backtest data with real-time data. It doesn't matter which platform you use some form of this condition will manifest itself on your chart over time. The critical aspect being whether live trades on your broker’s account continue to match your TradingView study. Since this trading system is featured as two separate scripts, indicator repainting is addressed in the study version. The strategy (this script) is intended to be used on historical data to determine the appropriate trading inputs to apply in the study. As such, the higher time frame of this strategy will indeed repaint. Please do not attempt to trade from the strategy. Please see the study version for more information.
One issue that comes up when comparing the strategy with the study is that the strategy trades show on the chart one bar later than the study. This problem is due to the fact that “strategy.entry()” and “strategy_exit()” do not execute on the same bar called. The study, on the other hand, has no such limitation since there are no position routines. However, alerts that are subsequently fired off when triggered in the study are dispatched from the TradingView servers one bar later from the study plot. Therefore the alert you actually receive on your cell phone matches the strategy plot but is one bar later than the study plot. A lot can happen in four hours if you are trading off a 240 bar.
Please be aware that the data source matters. Cryptocurrency has no central tick repository so each exchange supplies TradingView its feed. Even though it is the same symbol the quality of the data and subsequently the bars that are supplied to the chart varies with the exchange. This script will absolutely produce different results on different data feeds of the same symbol. Be sure to backtest this script on the same data you intend to receive alerts for. Any example settings I share with you will always have the exchange name used to generate the test results.
Usage
The following steps provide a very brief set of instructions that will get you started but will most certainly not produce the best backtest. A trading system that you are willing to risk your hard earned capital will require a well crafted configuration that involves time, expertise and clearly defined goals. As previously mentioned, I have several example configs that I use for my own trading that I can share with you along with a PDF which describes each input in detail. To get hands on experience in setting up your own symbol from scratch please follow the steps below.
The input dialog box contains over 50 inputs separated into seven sections. Each section is identified as such with a makeshift separator input. There are three main areas that must to be configured: long side, short side and settings that apply to both. The rest of the inputs apply to pyramids, DCA, reporting and calibrations. The following steps address these three main areas only. You will need to get your backtest in the black before moving on to the more advanced features
Step 1. Setup the Base currency and order size in the properties tab.
Step 2. Select the calculation presets in the Instrument Type field.
Step 3. Select “No Trade” in the Trading Mode field.
Step 4. Select the Histogram indicator from section 3. You will be experimenting with different ones so it doesn’t matter which one you try first.
Step 5. Turn on Show Markers in Section 3.
Step 6. Go to the chart and checkout where the markers show up. Blue is up and red is down. Long trades show up along the blue markers and short trades on the red.
Step 7. Make adjustments to Base To Vertex and Vertex To Base net change and roc in section 3. Use these fields to move the markers to where you want trades to be. Blue is long and red is short.
Step 8. Try a different indicator from section 3 and repeat Step 7 until you find the best match for this instrument on this interval. This step is complete when the Vertex settings and indicator combination produce the most favorable results.
Step 9. Turn off Show Markers in Section 3.
Step 10. Enable the Symmetrical and Deviation calculation models at the top of section 5 and 6 (Symmetrical, Deviation).
Step 11. Put in your Minimum Profit and Stop Loss in the first section. This is in pips or currency basis points (chart right side scale)
Step 12. Return to step 3 and select a Trading Mode (Long, Short, BiDir, Flip Flop). If you are planning to trade bidirectionally its best to configure long first then short. Combine them with BiDir or Flip Flop after setting up both sides of the trade individually.
Step 13. Trades should be showing on the chart.
Step 14. Make adjustments to the Vertex fields in section 3 until the TradingView performance report is showing a profit.
Step 15. Change indicators and repeat step 14. Pick the best indicator.
Step 16. Use the check boxes in sections 5 and 6 to improve the performance of each side.
Step 17. Try adding the Correlation calculation model to either side. This model can sometimes produce a negative result but can be improved by enabling “Adhere To Markers” or “Narrow Correlation Scope” in the sections 5 and 6.
Step 18. Enable the reporting conditions in section 7. Look for long runs of consecutive losses or high debt sequences. These are indications that your trading system cannot withstand sudden changes in market sentiment.
Step 19. Examine the chart and see that trades are being placed in accordance with your desired trading model.
Step 20. Apply the backtest settings to the study version and perform forward testing.
This script is open for beta testing. After successful beta test it will become a commercial application available by subscription only. I’ve invested quite a lot of time and effort into making this the best possible signal generator for all of the instruments I intend to trade. I certainly welcome any suggestions for improvements. Thank you all in advance.
SSL Channel BFSSL Channel Close is a great all-rounder based on 2 Simple Moving Averages, one of recent Highs, one of recent Lows.
The calculation prints a channel on the chart consisting of 2 lines.
This strategy gives a Long signal when price closes above the top of these 2 lines and a Short signal when it closes below the bottom.
Trading in choppy sideways markets can compound losses so we avoid that here by using recent ATR to determine relative volatility and refrain from trading when the background is White.
We use a basic 3% stop loss.
Charted on XBT/USD Bitmex Daily chart.
INSTRUCTIONS
Green = long
Red = short
White Background= No trade
The way I have set this strategy up is that if we get stopped out but we are still in a green or red background, we re-enter. Closing the trade only occurs on an opposing signal or if we get stopped out.
Super Trend 4hr XBT BFThis script is designed for XBT/USD on Bitmex 4hr chart .
The signals are generated from a calculation of the overall super trend using ATR.
The stop loss level is also determined by a separate ATR calculation. This allows for dynamic stop loss placement depending on how volatile the market. Lower ATR = tighter Stop.
I tried a Take-Profit function but it seems the best results I can find come from exiting a trade upon an opposing signal.
INSTRUCTIONS
1. Go Long when background turns green, or short when it turns red.
2. Set your stop loss as indicated on the chart by the dotted lines. Yellow is stop loss for a long signal, orange for short.
3. Exit on an opposing signal.
NB: the Stop losses are only plotted on the chart when we are not stopped out. If we get stopped out, we wait for the next signal.
RSI - Oversold BTC StrategyWhen BTC goes through a large swing downward, it often goes into oversold territory and quickly swings back upwards. This strategy is designed to capitalize on the swings without gettings stopped-out with the surrounding volatility. I find that this strategy works best on the 5 minute chart.
You can set the maximum loss (in dollars), trade size (in BTC ), plus your trailing stop and offset (pips).
The blue line on the graph indicates your stop loss point, which trails your buy-in point by your specified maximum loss. Remember, in this strategy, this stop-loss is only used to protect you from unexpected large swings, your trailing stop loss is used to capture profits.
DAILY TARI Hi guys!
This is maybe my most powerfull strategy. It's only for DAILY CHARTS.
Since the chart is D you have to look at it only 1 minute per day as the new candel appears.
You will find the signal to BUY or to SELL, the TAKE PROFIT and STOP LOSS or TRAILING STOP LOSS.
The idea behind this is the volatility and an oscillator based on the volatility, plus something extra.
The back test here is with Euro/USD because you can see the last 25 years, but feel free to try any other currencies!.
The default TP is 200 pips and SL 200 pips too.
If you us Stop Loss try even in the range 22-80. If you use Trailing Stop Loss 200 is ok.
You can have even a Risk/Reward ratio around 10!
There is another input, called TARI. It works as a filter, rising it you will have less trades but with higher returns.
You can have a free trial on request.
To use this strategy you need to subscribe 50€/month! Check out on my page!
Enjoy your wallet!
Tari.
RSI Buy/sell signal with TP_SL_TL_15min by rajistaRSI Buy/sell signal with TakeProfit_Stop loss_Trailing_SL script -can be used on any altcoin/btc pair on the 15min chart .
This script can be used for backtesting pupose and also to give buy/sell signals based on the settings provided by you.
Benefits of the script:
1> Fully customizable script according to your trade setups.
2> The script incorporates Take-profit, Stop-loss & Trailing SL.
3> Cuts your losses significantly, in comparision to a script without TP, SL & TL strategies.
4> Based on RSI Overbought/Oversold levels, which can also be customizable.
5> Doesn't take too many trades in a day, thereby decreasing commission paid to exchanges & hence enhances the overall profit.
Here's how, you can fully customize the script, according to your strategy, once you have been provided access:
( To gain access to the script just hit the like/comment in the #tradingview published article & i'll grant access based on your tradingview userid )
You can add this script to your charts in 15min timeframe, like adding any other simple indicator.
Once you have added the script, just hit the settings button to fully customize the script according to your strategy and plan, that you have, for your trade setup.
Take profit, Stop loss, Trailing Stop loss values can be entered in satoshis from the setting panel.
RSI Overbought & Oversold values can also be entered according to your trading setup.
Like in below example , i have put the following values as default
Test date is set as 1 May 2018
Take profit=1000, stop loss=5, Trailing SL=40
RSI Overbought=70, Oversold=20
" Above mentioned values are default values and may not be profitable in every condition, you have to backtest the strategy by changing these values and then see the results of given values under the Strategy tester tab- located at bottom of your #tradingview chart. "
Lets see how the scipt is able to make these awesome gains:
Suppose your script enters a trade(buys Verge) when #Verge is at 800sats
Then the bot will close the trade(sell Verge) when either of these things happen:
a> Verge surges to 1800 sats, then the script will close trade by Taking profit
b>Verge increases to 850 only, but the RSI value in 15min chart has gone above 70 (Overbought-default value) then scipt will close trade.
c>Verge decreases to 995 sats, then script will close trade by Stop loss hit.
d>Verge surges to 840 but then again drops slightly to 835, script will again close trade by Trailing SL hit.
Initial capital is set to 10 btc
Make sure to check the performance summary tab below and overview of the script running on #XVGBTC since 1 May 2018-Till date
Profit -11.6% while running script
Where Buy and hold return for verge in the same period is:
- to get an instant notification, once i publish a script or a trading analysis/trade-setup , which will always be available for free for everyone!!!
External Signals Strategy Tester v5External Signals Strategy Tester v5 – User Guide (English)
1. Purpose
This Pine Script strategy is a universal back‑tester that lets you plug in any external buy/sell series (for example, another indicator, webhook feed, or higher‑time‑frame condition) and evaluate a rich set of money‑management rules around it – with a single click on/off workflow for every module.
2. Core Workflow
Feed signals
Buy Signal / Sell Signal inputs accept any series (price, boolean, output of request.security(), etc.).
A crossover above 0 is treated as “signal fired”.
Date filter
Start Date / End Date restricts the test window so you can exclude unwanted history.
Trade engine
Optional Long / Short enable toggles.
Choose whether opposite signals simply close the trade or reverse it (flip direction in one transaction).
Risk modules – all opt‑in via check‑boxes
Classic % block – fixed % Take‑Profit / Stop‑Loss / Break‑Even.
Fibonacci Bollinger Bands (FBB) module
Draws dynamic VWMA/HMA/SMA/EMA/DEMA/TEMA mid‑line with ATR‑scaled Fibonacci envelopes.
Every line can be used for stops, trailing, or multi‑target exits.
Separate LONG and SHORT sub‑modules
Each has its own SL plus three Take‑Profits (TP1‑TP3).
Per TP you set line, position‑percentage to close, and an optional trailing flag.
Executed TP/SLs deactivate themselves so they cannot refire.
Trailing behaviour
If Trail is checked, the selected line is re‑evaluated once per bar; the order is amended via strategy.exit().
3. Inputs Overview
Group Parameter Notes
Trade Settings Enable Long / Enable Short Master switches
Close on Opposite / Reverse Position How to react to a counter‑signal
Risk % Use TP / SL / BE + their % Traditional fixed‑distance management
Fibo Bands FIBO LEVELS ENABLE + visual style/length Turn indicator overlay on/off
FBB LONG SL / TP1‑TP3 Enable, Line, %, Trail Rules applied only while a long is open
FBB SHORT SL / TP1‑TP3 Enable, Line, %, Trail Rules applied only while a short is open
Line choices: Basis, 0.236, 0.382, 0.5, 0.618, 0.764, 1.0 – long rules use lower bands, short rules use upper bands automatically.
4. Algorithm Details
Position open
On the very first bar after entry, the script checks the direction and activates the corresponding LONG or SHORT module, deactivating the other.
Order management loop (every bar)
FBB Stop‑Loss: placed/updated at chosen band; if trailing, follows the new value.
TP1‑TP3: each active target updates its limit price to the selected band (or holds static if trailing is off).
The classic % block runs in parallel; its exits have priority because they call strategy.close_all().
Exit handling
When any strategy.exit() fires, the script reads exit_id and flips the *_Active flag so that order will not be recreated.
A Stop‑Loss (SL) also disables all remaining TPs for that leg.
5. Typical Use Cases
Scenario Suggested Setup
Scalping longs into VWAP‐reversion Enable LONG TP1 @ 0.382 (30 %), TP2 @ 0.618 (40 %), SL @ 0.236 + trailing
Fade shorts during news spikes Enable SHORT SL @ 1.0 (no trail) and SHORT TP1,2,3 on consecutive lowers with small size‑outs
Classic trend‑follow Use only classic % TP/SL block and disable FBB modules
6. Hints & Tips
Signal quality matters – this script manages exits, it does not generate entries.
Keep TV time zone in mind when picking start/end dates.
For portfolio‑style testing allocate smaller default_qty_value than 100 % or use strategy.percent_of_equity sizing.
You can combine FBB exits with fixed‑% ones for layered management.
7. Limitations / Safety
No pyramiding; the script holds max one position at a time.
All calculations are bar‑close; intra‑bar touches may differ from real‑time execution.
The indicator overlay is optional, so you can run visual‑clean tests by unchecking FIBO LEVELS ENABLE.
PEAD strategy█ OVERVIEW
This strategy trades the classic post-earnings announcement drift (PEAD).
It goes long only when the market gaps up after a positive EPS surprise.
█ LOGIC
1 — Earnings filter — EPS surprise > epsSprThresh %
2 — Gap filter — first regular 5-minute bar gaps ≥ gapThresh % above yesterday’s close
3 — Timing — only the first qualifying gap within one trading day of the earnings bar
4 — Momentum filter — last perfDays trading-day performance is positive
5 — Risk management
• Fixed stop-loss: stopPct % below entry
• Trailing exit: price < Daily EMA( emaLen )
█ INPUTS
• Gap up threshold (%) — 1 (gap size for entry)
• EPS surprise threshold (%) — 5 (min positive surprise)
• Past price performance — 20 (look-back bars for trend check)
• Fixed stop-loss (%) — 8 (hard stop distance)
• Daily EMA length — 30 (trailing exit length)
Note — Back-tests fill on the second 5-minute bar (Pine limitation).
Live trading: enable calc_on_every_tick=true for first-tick entries.
────────────────────────────────────────────
█ 概要(日本語)
本ストラテジーは決算後の PEAD を狙い、
EPS サプライズがプラス かつ 寄付きギャップアップ が発生した銘柄をスイングで買い持ちします。
█ ロジック
1 — 決算フィルター — EPS サプライズ > epsSprThresh %
2 — ギャップフィルター — レギュラー時間最初の 5 分足が前日終値+ gapThresh %以上
3 — タイミング — 決算当日または翌営業日の最初のギャップのみエントリー
4 — モメンタムフィルター — 過去 perfDays 営業日の騰落率がプラス
5 — リスク管理
• 固定ストップ:エントリー − stopPct %
• 利確:終値が日足 EMA( emaLen ) を下抜け
█ 入力パラメータ
• Gap up threshold (%) — 1 (ギャップ条件)
• EPS surprise threshold (%) — 5 (EPS サプライズ最小値)
• Past price performance — 20 (パフォーマンス判定日数)
• Fixed stop-loss (%) — 8 (固定ストップ幅)
• Daily EMA length — 30 (利確用 EMA 期間)
注意 — Pine の仕様上、バックテストでは寄付き 5 分足の次バーで約定します。
実運用で寄付き成行に合わせたい場合は calc_on_every_tick=true を有効にしてください。
────
ご意見や質問があればお気軽にコメントください。
Happy trading!